﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Exhibition.Dao.ViewModel;
using Exhibition.Service;

namespace Exhibition
{
    public partial class NavDetail : BasePage
    {
        public NavModel mdl = new NavModel();
        public int tpid = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["tpid"] != null)
            {
                try
                {
                    tpid = Convert.ToInt32(Request["tpid"]);
                }
                catch (Exception)
                {

                    Response.Write("系统错误，请联系管理员");
                }
            }
            if (!IsPostBack) {
                LoadData();
            }
        }

        private void LoadData()
        {
            mdl = CenterService.navService.GetOneById(tpid);
            if (mdl.IsSingle == 1) {
                Response.Redirect("NewsList.aspx?tpid="+tpid);
            }

        }
    }
}